package com.ruoyi.bl.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bl.mapper.BlOrderGoodsMapper;
import com.ruoyi.bl.domain.BlOrderGoods;
import com.ruoyi.bl.service.IBlOrderGoodsService;

/**
 * 订单商品Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-11
 */
@Service
public class BlOrderGoodsServiceImpl implements IBlOrderGoodsService 
{
    @Autowired
    private BlOrderGoodsMapper blOrderGoodsMapper;

    /**
     * 查询订单商品
     * 
     * @param orderGoodsId 订单商品主键
     * @return 订单商品
     */
    @Override
    public BlOrderGoods selectBlOrderGoodsByOrderGoodsId(Long orderGoodsId)
    {
        return blOrderGoodsMapper.selectBlOrderGoodsByOrderGoodsId(orderGoodsId);
    }

    /**
     * 查询订单商品列表
     * 
     * @param blOrderGoods 订单商品
     * @return 订单商品
     */
    @Override
    public List<BlOrderGoods> selectBlOrderGoodsList(BlOrderGoods blOrderGoods)
    {
        return blOrderGoodsMapper.selectBlOrderGoodsList(blOrderGoods);
    }

    /**
     * 新增订单商品
     * 
     * @param blOrderGoods 订单商品
     * @return 结果
     */
    @Override
    public int insertBlOrderGoods(BlOrderGoods blOrderGoods)
    {
        blOrderGoods.setCreateTime(DateUtils.getNowDate());
        return blOrderGoodsMapper.insertBlOrderGoods(blOrderGoods);
    }

    /**
     * 修改订单商品
     * 
     * @param blOrderGoods 订单商品
     * @return 结果
     */
    @Override
    public int updateBlOrderGoods(BlOrderGoods blOrderGoods)
    {
        blOrderGoods.setUpdateTime(DateUtils.getNowDate());
        return blOrderGoodsMapper.updateBlOrderGoods(blOrderGoods);
    }

    /**
     * 批量删除订单商品
     * 
     * @param orderGoodsIds 需要删除的订单商品主键
     * @return 结果
     */
    @Override
    public int deleteBlOrderGoodsByOrderGoodsIds(Long[] orderGoodsIds)
    {
        return blOrderGoodsMapper.deleteBlOrderGoodsByOrderGoodsIds(orderGoodsIds);
    }

    /**
     * 删除订单商品信息
     * 
     * @param orderGoodsId 订单商品主键
     * @return 结果
     */
    @Override
    public int deleteBlOrderGoodsByOrderGoodsId(Long orderGoodsId)
    {
        return blOrderGoodsMapper.deleteBlOrderGoodsByOrderGoodsId(orderGoodsId);
    }
}
